package net.cloudsun.graph.util;

import java.io.File;
import java.io.IOException;

/**
 * 文件工具
 * created at 25/11/2021
 *
 * @author 俞建波
 * <a href="mailto://yujianbo@chtwm.com">yujianbo@chtwm.com</a>
 * @since 1.2.0
 */
public class FileUtils {

    public static File initDirAndFile(String sqlDirName, String sqlFileName) throws IOException {
        final File dir = new File(sqlDirName);
        if (!dir.exists()) {
            dir.mkdirs();
        }
        final File file = new File(sqlDirName + "/" + sqlFileName);
        if (!file.exists()) {
            file.createNewFile();
        }
        return file;
    }
}
